Skip to main content

eth_sendUserOperation

This method is used to send a user operation to the bundler for inclusion.

Parameters

  1. userOperation: A JSON object representing the user operation to send.

  2. entryPoint: The entry point to use for the user operation.

note

As specified in the 4337 specification, user operations must satisfy the following:

  • factory and factoryData are either both present or both absent.
  • Either the sender is an existing contract, or the the factory fields are not empty.
  • paymaster, paymasterData, paymasterVerificationGasLimit, and paymasterPostOpGasLimit are either all present or all absent.

Returns

A string representing the hash of the user operation, or an error.

Example Request

{
"jsonrpc":"2.0",
"id":1,
"method":"eth_sendUserOperation",
"params":[
{
"sender":"0x1234567890123456789012345678901234567890",
"nonce":"0x1",
"factory":"0x1234567890123456789012345678901234567890",
"factoryData":"0x123456",
"callData":"0x123456",
"callGasLimit":"0x123456",
"verificationGasLimit":"0x123456",
"preVerificationGas":"0x123456",
"maxFeePerGas":"0x123456",
"maxPriorityFeePerGas":"0x123456",
"paymaster":"0x1234567890123456789012345678901234567890",
"paymasterVerificationGasLimit":"0x123456",
"paymasterPostOpGasLimit":"0x123456",
"paymasterData":"0x123456",
"signature":"0x123456"
},
"0x0000000071727De22E5E9d8BAf0edAc6f37da032"
]
}

Example Response

{
"jsonrpc":"2.0",
"id":1,
"result":"0x1234567890123456789012345678901234567890123456789012345678901234"
}

Example Error

{
"jsonrpc":"2.0",
"id":1,
"error":{
"code":-32000,
"message":"AA20 Account Not Deployed"
}
}